﻿using System.Collections.Generic;
using OrderMicroService.Types.Types;

namespace OrderMicroService.Domain.Domain.Entity
{
    /// <summary>
    /// 主订单
    /// </summary>
    public class Order : IAggregate<OrderId>
    {
        public OrderId OrderId { get; set; }

        /// <summary>
        /// 子订单列表
        /// </summary>
        public List<LineItem> LineItems { get; set; }

        /// <summary>
        /// 总价
        /// </summary>
        public decimal TotalPrice { get; set; }

        public OrderId GetId()
        {
            return OrderId;
        }

        public void SetId(long value)
        {
            OrderId = new OrderId(value);
        }
    }
}